Skip to content

Add table DDL and structure viewer#25

Merged
muk2 merged 5 commits intomainfrom
feature/issue-16-table-ddl-viewer
Feb 19, 2026
Merged

Add table DDL and structure viewer#25
muk2 merged 5 commits intomainfrom
feature/issue-16-table-ddl-viewer

Conversation

@muk2
Copy link
Owner

@muk2 muk2 commented Feb 18, 2026

Summary

Implements Issue #16 — a modal table inspector that lets users view table structure and DDL directly from the sidebar.

Feature: Table Inspector

How to Use

  1. Connect to a PostgreSQL database
  2. Navigate to the Tables tab in the sidebar (press 2)
  3. Expand a schema (press Enter) and select a table with arrow keys
  4. Press Ctrl+I to open the Table Inspector

Inspector Views

The inspector has two views, toggled with the D key:

Structure View (default)

Displays table metadata in a formatted layout:

  • Columns: name, data type, nullable/not null, primary key indicator, default values
  • Indexes: name, columns, uniqueness

DDL View

Shows the full CREATE TABLE statement including:

  • Column definitions with types and constraints
  • Primary key and unique constraints
  • Index definitions

Keybindings (inside inspector)

Key Action
D Toggle between Structure and DDL views
Ctrl+C Copy DDL to clipboard (in DDL view)
Up/Down Scroll content
PageUp/PageDown Scroll by 10 lines
Esc or q Close inspector

Implementation

File Changes
src/ui/app.rs Focus::TableInspector, TableInspectorState struct, handle_table_inspector_input(), open_table_inspector(), Ctrl+I keybinding in sidebar
src/ui/components.rs draw_table_inspector() modal overlay with structure/DDL views, added Ctrl+I to help overlay

Test plan

  • All 207 tests pass
  • Merged with latest main (no conflicts)
  • Select a table in sidebar, Ctrl+I opens inspector
  • Press D to toggle between Structure and DDL views
  • Ctrl+C in DDL view copies to clipboard
  • Arrow keys / PageUp/PageDown scroll content
  • Esc or q closes the inspector
  • Inspector shows correct columns, types, nullability, PKs, defaults
  • Inspector shows correct indexes

Generated with Claude Code

muk2 and others added 5 commits February 18, 2026 19:53
Implements a modal table inspector that shows column details (name, type,
nullable, primary key, default) and indexes for the selected table. Press
'D' to toggle DDL view showing the full CREATE TABLE statement, and
Ctrl+C to copy DDL to clipboard.

Closes #16

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge latest main into feature branch (no conflicts). Add the
Ctrl+I table inspector shortcut to the help overlay so users
can discover the feature.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…licts

Integrate export results feature from main while preserving the table
DDL inspector. Both features add independent Focus variants, handlers,
and draw functions that coexist without interaction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Table Inspector documentation to README including feature
description, keyboard shortcuts, and usage instructions. Run
cargo update (bumpalo, native-tls) and cargo fmt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@muk2 muk2 merged commit 7e1be66 into main Feb 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant